package
{
	import mx.collections.ArrayCollection;
	import mx.utils.StringUtil;
	
	[Bindable]
	/**
	 * 
	 * @author daniele
	 * 
	 */	
	public class StreamLocation
	{
		public static const TYPE_FILE:String = "file";
		public static const TYPE_HTTP:String = "http";
		public static const TYPE_DISPLAY:String = "display";
		
		public static const DATABINGING_FILE:String = "dst=std{access=file,mux=ffmpeg{mux=flv},dst={0}}";
		public static const DATABINGING_HTTP:String = "dst=std{access=http,mux=ffmpeg{mux=flv},dst={0}:{1}/{2}}";
		public static const DATABINGING_DISPLAY:String = "dst=display";
		
		
		public var label:String;
		public var type:String;
		public var dataBinding:String;
		public var editor:int;
		public var result:String;
		public var args:ArrayCollection = new ArrayCollection();
		public var defaultArgs:Array;
		public var deletable:Boolean;
		/**
		 * 
		 * 
		 */		
		public function StreamLocation()
		{
			
		}
		
		public function computeResult():void
		{
			result =  StringUtil.substitute(dataBinding,args.source);
		}
		/**
		 * 
		 * 
		 */		
		public function toString():String
		{
			return result;
		}
		/**
		 * 
		 * @return 
		 * 
		 */		
		public function clone():StreamLocation
		{
			var clone:StreamLocation = new StreamLocation();
			clone.label = label;
			clone.type = type;
			clone.dataBinding = dataBinding;
			clone.args = args;
			clone.editor = editor;
			clone.result = result;
			clone.deletable = deletable;
			clone.defaultArgs = defaultArgs;
			return clone;
		}

	}
}